From b2fc84d18589531522ded3e2e7960b705c87f04e Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Fri, 28 Apr 2023 15:37:54 -0600 Subject: [PATCH] set timespec to UTC in new skytraq code. (#1094) I wish Qt would default to UTC instead of Local Time! --- skytraq.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skytraq.cc b/skytraq.cc index a228e6e65..239c18bfa 100644 --- a/skytraq.cc +++ b/skytraq.cc @@ -531,7 +531,7 @@ SkytraqBase::gpstime_to_qdatetime(int week, int sec) const int override = xstrtoi(opt_gps_utc_offset, nullptr, 10); if (override) { gps_timet -= override; - return QDateTime::fromSecsSinceEpoch(gps_timet); + return QDateTime::fromSecsSinceEpoch(gps_timet, Qt::UTC); } /* leap second compensation: */ @@ -554,7 +554,7 @@ SkytraqBase::gpstime_to_qdatetime(int week, int sec) const // Future: Consult http://maia.usno.navy.mil/ser7/tai-utc.dat // use http://www.stevegs.com/utils/jd_calc/ for Julian to UNIX sec - return QDateTime::fromSecsSinceEpoch(gps_timet); /* returns UTC time */ + return QDateTime::fromSecsSinceEpoch(gps_timet, Qt::UTC); } void -- 2.30.2